<?php global $user, $base_url; ?>
<div class="addresses_wrapper">
    <ul class="add_items">
        <?php if ($data['addresses']->rowCount() > 0): ?>
        <?php foreach ($data['addresses'] as $address): ?>
            <li>
                <div class="add_item">
                    <div class="add_info">
                        <address>
                            <table class="addresses_book">
                                <tbody>
                                <tr>
                                    <th>Name</th>
                                    <td><?php print $address->name;?></td>
                                </tr>
                                <tr>
                                    <th>Address 1</th>
                                    <td><?php print $address->address1;?></td>
                                </tr>
                                <tr>
                                    <th>Address 2</th>
                                    <td><?php print $address->address2;?></td>
                                </tr>
                                <tr>
                                    <th>City</th>
                                    <td><?php print $address->city;?></td>
                                </tr>
                                <tr>
                                    <th>Postal Code</th>
                                    <td><?php print $address->zipcode;?></td>
                                </tr>
                                <tr>
                                    <th>Country</th>
                                    <td><?php print $address->country;?></td>
                                </tr>
                                <tr>
                                    <th>Phone Number</th>
                                    <td><?php print $address->phone;?></td>
                                </tr>
                                </tbody>
                            </table>
                        </address>

                    </div>
                    <?php if($data['addresses']->rowCount() > 1):?>
                    <div class="actions">
                        <?php print l(t('Edit'), 'address/' . $address->aid . '/edit', array('attributes' => array('class' => array('btn', 'btn-primary', 'btn-left'))));?>
                        <?php print l(t('Delete'), 'address/' . $address->aid . '/delete', array('attributes' => array('class' => array('btn', 'btn-danger', 'btn-right'))));?>
                        <div class="clear"></div>
                    </div>
                <?php endif;?>
                </div>
            </li>
            <?php endforeach; ?>
        <?php endif;?>
        <div class="clear"></div>
    </ul>
</div>